package com.jungle.mogo.entity.pojo;

import com.anwen.mongo.annotation.collection.CollectionField;
import com.anwen.mongo.annotation.collection.CollectionLogic;
import com.anwen.mongo.enums.FieldFill;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author Jungle
 * @create 2024-12-19 12:09
 */
@Data
public class BaseEntity {
    @CollectionLogic( value = "0",delval = "1")
    private String delFlag;
    @CollectionField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @CollectionField(fill = FieldFill.UPDATE)
    // 影响输入和输出
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    // 只会影响表单的输入
    // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
